// @ts-ignore
/* eslint-disable */
import request from '@/request'

/** 此处后端没有提供注释 POST /resource/add */
export async function addResource(body: API.ResourceAddRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/resource/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /resource/add/url */
export async function addResourceWithUrl(
  body: API.ResourceAddWithUrlRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>('/resource/add/url', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /resource/delete */
export async function deleteResource(body: API.DeleteRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/resource/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /resource/delete/batch */
export async function deleteResourceWithBatch(body: number[], options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/resource/delete/batch', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /resource/list/page */
export async function listResourceByPage(
  body: API.ResourceQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageAdminResourceVO>('/resource/list/page', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /resource/list/page/vo */
export async function listResourceVoByPage(
  body: API.ResourceQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageResourceVO>('/resource/list/page/vo', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /resource/statistic/total */
export async function getTotalResourceCount(options?: { [key: string]: any }) {
  return request<API.BaseResponseStatisticResourceVO>('/resource/statistic/total', {
    method: 'POST',
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /resource/update */
export async function updateResource(
  body: API.ResourceUpdateRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>('/resource/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
export async function uploadResourceFile(file:File, options?: { [key: string]: any }) {
// 使用 FormData 构建请求体
  const formData = new FormData();
  formData.append('file', file); // 将文件添加到 FormData

  return request<API.BaseResponseUploadReturnVO>('/resource/upload', {
    method: 'POST',
    data: formData,
    ...(options || {}),
  })
}
